// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CapacityDataForResolver.cs" company="">
//   
// </copyright>
// <summary>
//   The capacity data for resolver.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace XRay.Library
{
    using System;

    using AutoMapper;

    using Microsoft.WindowsAzure.Storage.Analytics;

    using XRay.Library.Contracts;

    /// <summary>
    /// The capacity data for resolver.
    /// </summary>
    public class CapacityDataForResolver : ValueResolver<CapacityEntity, CapacityDataType>
    {
        #region Methods

        /// <summary>
        /// The resolve core.
        /// </summary>
        /// <param name="source">
        /// The source.
        /// </param>
        /// <returns>
        /// The <see cref="CapacityDataType"/>.
        /// </returns>
        protected override CapacityDataType ResolveCore(CapacityEntity source)
        {
            return (CapacityDataType)Enum.Parse(typeof(CapacityDataType), source.RowKey);
        }

        #endregion
    }
}